﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace mapeditor
{
    class table2d
    {
        public int nbre_cases;
        public int[,] tableau;
        public Vector2 vecteur = Vector2.Zero;
        int j = 0;

        public table2d(int nbre)
        {
            nbre_cases = nbre;
            tableau = new int[nbre_cases, 3];
        }

        public void Init()
        {
            for (int i = 0; i < nbre_cases; i++)
            {
                tableau[i, 0] = -1;
                tableau[i, 1] = -1;
                tableau[i, 2] = -1;
            }
        }

        public void Add(int type, int x, int y)
        {
            if (j >= nbre_cases)
            {
                j = 0;
            }

            tableau[j, 0] = type;
            tableau[j, 1] = x;
            tableau[j, 2] = y;
            j++;
        }
    }
}
